<% content_for :title do %>
    Show all users
<% end %>
<h1>This is the index page of users</h1>
    <table>
        <tr>
            <th>First Name</th>
            <th>Last Name</th>
            <th>Email</th>
            <th>Actions</th>
        </tr>
    <% @users.each do |user| %>
        <tr>
            <td><%= user.first_name %></td>
            <td><%= user.last_name %></td>
            <td><%= user.email_address %></td>
            <td>
                <%= link_to "Show", user_path(user)%>
                <%= link_to "Edit", edit_user_path(user)%>
                <%= link_to "Delete", user_path(user), method: :delete, data: {confirm: 'Are you sure?'}%>
            </td>
            
        </tr>
    <% end %>
</table>
<%= link_to "Add User", new_user_path%>
